package Work0529;

public class Staff implements Comparable<Staff> {
	private String name;// 姓名
	private int old;// 年龄
	private String sex;// 性别
	private String post;// 职务
	private int salary;// 薪水
	private int jobNo;// 工号

	public Staff(String name, int old, String sex, String post, int salary, int jobNo) {
		super();
		this.name = name;
		this.old = old;
		this.sex = sex;
		this.post = post;
		this.salary = salary;
		this.jobNo = jobNo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getOld() {
		return old;
	}

	public void setOld(int old) {
		this.old = old;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getPost() {
		return post;
	}

	public void setPost(String post) {
		this.post = post;
	}

	public int getSalary() {
		return salary;
	}

	public void setSalary(int salary) {
		this.salary = salary;
	}

	public int getJobNo() {
		return jobNo;
	}

	public void setJobNo(int jobNo) {
		this.jobNo = jobNo;
	}

	@Override
	public int compareTo(Staff o) {

		return this.old - o.old;
	}

	@Override
	public String toString() {
		return "Staff [name=" + name + ", old=" + old + ", sex=" + sex + ", post=" + post + ", salary=" + salary
				+ ", jobNo=" + jobNo + "]";
	}

	public void show() {
		System.out.println(name + "\t" + old + "\t" + sex + "\t" + post + " \t" + salary + "\t" + jobNo);
	}
}
